package com.stu.entity.service;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.stu.entity.base.BaseEntity;
import com.stu.entity.permission.PermissionUser;


@Entity
@Table(name = "ANSWER")
public class Answer extends BaseEntity{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String content;
	
	private PermissionUser user;
	private Question question;
	
	@Column(name = "content", length = 1000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user")
	public PermissionUser getUser() {
		return user;
	}
	public void setUser(PermissionUser user) {
		this.user = user;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "question")
	public Question getQuestion() {
		return question;
	}
	public void setQuestion(Question question) {
		this.question = question;
	}
	public Answer() {
		super();
	}
	public Answer(String uuid) {
		super(uuid);
	}
	@Override
	public String toString() {
		return "Answer [content=" + content + ", user=" + user + ", question=" + question + "]";
	}
	
	
	
	

}
